home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM 2.0.1 Licensing Disk / Sources / InstallerTypes.r < prev   
Encoding:
Text File  |  1996-11-19  |  37.1 KB  |  1,104 lines  |  [TEXT/MPS ]

  1. /*
  2.     LEGALESE:    © 1988-1993 Apple Computer, Inc.  All Rights Reserved
  3.     
  4.     PROJECT:    Installer 4.0
  5.     
  6.     PROGRAM:    Installer
  7.     
  8.     AUTHORS:    Bruce Jones, Cindy Frost, Bobby Carp, Kevin Aitken, Afshin Jalalian
  9.     
  10.     PURPOSE:    This file contains all the resource templates necessary to
  11.                 create installer scripts.
  12.  
  13. */
  14.  
  15.  
  16. #include "SysTypes.r"                                    /* For region codes */
  17.  
  18. /* For those using pre-7.0 "SysTypes.r" we need to define region.  It used */
  19. /* to be country, but became region in 7.0 */
  20.  
  21. #ifndef region
  22. #define region country
  23. #endif
  24.  
  25.  
  26. /*----------------------------Installer 3.0 Scripts-----------------------------------*/
  27.  
  28. #define evenPaddedString                                                                                        \
  29.     pstring;                                                                                                    \
  30.     align word
  31.  
  32.  
  33. #define OSType                                                                                                    \
  34.     literal longint
  35.     
  36.     
  37. #define rsrcType                                                                                                \
  38.     OSType                                                /* type of a rsrc which must exist in system */            \
  39.         patchrsrcType = 'PTCH',                                                                                    \
  40.         userFunctionType = 'infn',                                                                                \
  41.         auditrsrcType = 'audt'
  42.  
  43.  
  44. #define rsrcID                                                                                                    \
  45.     integer                                                /* ID of a rsrc which must exist in system */            \
  46.         macPlusPatch = 117,                                                                                        \
  47.         macSEPatch = 630,                                                                                        \
  48.         macIIPatch = 376,                                                                                        \
  49.         portablePatch = 890,                                                                                    \
  50.         macIIciPatch = 1660,                                                                                    \
  51.         oldAuroraPatch = 1657
  52.  
  53. #define SrcDiskType                                                                                                    \
  54.     integer                                                /* Expected type of src source disk */                    \
  55.         kExpectFloppyDisk     = 0,                                                                                \
  56.         kExpectCDVolume     = 1,                                                                                \
  57.         kExpectFoldersOnVol = 2
  58.  
  59.  
  60. #define RsrcName                                                                                                \
  61.     evenPaddedString
  62.  
  63. /*
  64. § --------------------------------- Packages ---------------------------------*/
  65. #define    packageFlags                                                                                             \
  66.         boolean        doesntShowOnCustom, showsOnCustom;        /* should show up on Custom screen     */                \
  67.         boolean        notRemovable, removable;                /* this package can be removed     */                    \
  68.         boolean        forceRestart, dontForceRestart;            /* should installing this package for a restart? */    \
  69.         fill bit[13]                                        /* Reserved */ 
  70.  
  71. #define    partSpec                                                                                                \
  72.         rsrcType;                                            /* Part Type: inpk, infa, inra… */                 \
  73.         rsrcID                                                /* Part ID */
  74.  
  75.  
  76. type 'inpk' {
  77.         switch {
  78.             case format0:
  79.                 key integer = 0;                            /* Package Format version */
  80.                 packageFlags;                                /* Package Flags */
  81.                 rsrcID;                                        /* icmt ID */
  82.                 unsigned longint;                            /* Package Size */
  83.                 evenPaddedString;                            /* Package Name */
  84.                 unsigned integer = $$CountOf(partsList);    /* Parts List */
  85.                 wide array partsList {
  86.                     partSpec;                                /* Parts Spec */
  87.                 };
  88.     
  89.         };
  90. };
  91.  
  92.  
  93. type 'icmt' {                                                /* Installer comment */
  94.         unsigned hex longint;                                /* Creation Date  */
  95.         unsigned hex longint;                                /* Version */
  96.         rsrcID;                                                /* Icon ID */
  97.         evenPaddedString;                                    /* Comment Text */
  98. };
  99.  
  100.  
  101. type 'inpc' {                                                /* New Custom Item comment */
  102.         switch {
  103.             case format1:
  104.                 key integer = 1;                            /* Custom Item Format version */
  105.                 unsigned hex longint;                        /* Custom Item Date  */
  106.                 unsigned hex longint;                        /* Custom Item Version */
  107.                 unsigned longint;                            /* Custom Item RAM Requirements */
  108.                 rsrcID;                                        /* Custom Item Icon ID */
  109.                 rsrcID;                                        /* Custom Item Description ('TEXT' resource ID ) */
  110.         };
  111. };
  112.  
  113.  
  114. /*
  115. § --------------------------------- File Specs ---------------------------------*/
  116. #define fileSpecID                                                                                                \
  117.         rsrcID
  118.  
  119.  
  120. #define    fileSpecFlags                                                                                            \
  121.         boolean        noSearchForFile, SearchForFile;            /* Search (tgt only) if not found in given path*/    \
  122.         boolean        TypeCrNeedNotMatch, TypeCrMustMatch;    /* Type and creator must match    */                    \
  123.         fill bit[14]                                        /* currently unused    */
  124.  
  125. type    'infs' {                                                        
  126.         OSType;                                                /* File Type    */
  127.         OSType;                                                /* File Creator    */
  128.         unsigned hex longint;                                /* Creation Date*/ 
  129.         fileSpecFlags;                                        /* File Spec Flags */
  130.         evenPaddedString;                                    /* Full Path */
  131. };
  132.  
  133. /*
  134. § --------------------------------- Target File Spec ---------------------------------*/
  135. #define    targetFileSpecFlags                                                                                            \
  136.         boolean        noSearchForFile, SearchForFile;            /* Search by calling the referenced 'insp' resource */    \
  137.         boolean        TypeCrNeedNotMatch, TypeCrMustMatch;    /* Type and creator must match    */                    \
  138.         fill bit[14]                                        /* currently unused    */
  139.  
  140. type 'intf' {                                                        
  141.     switch {
  142.         case format0:
  143.             key integer = 0;            /* Target File Spec. Format version */
  144.             targetFileSpecFlags;        /* Target File Spec. Flags */
  145.             OSType;                        /* Target File Type */
  146.             OSType;                        /* Target File Creator */
  147.             rsrcID;                        /* Search Proc. Rsrc ID */ 
  148.             evenPaddedString;            /* Target File Path */
  149.         
  150.         case format1:
  151.             key integer = 1;            /* Target File Spec. Format version */
  152.             targetFileSpecFlags;        /* Target File Spec. Flags */
  153.             OSType;                        /* Target File Type */
  154.             OSType;                        /* Target File Creator */
  155.             unsigned hex integer;        /* Target File Finder Flags */
  156.             unsigned hex longint;        /* Target File Creation Date of new file */
  157.             unsigned hex longint;        /* Target File Mod. Date of new file */
  158.             rsrcID;                        /* Search Proc. Rsrc ID */ 
  159.             evenPaddedString;            /* Target File Path */
  160.     };
  161. };
  162.  
  163. /*
  164. § --------------------------------- File Atoms ---------------------------------*/
  165. #define    opcodeFlags                                                                                             \
  166.         boolean        dontDeleteWhenRemoving, deleteWhenRemoving;            /* Remove file or rsrc if remove clicked */    \
  167.         boolean        dontDeleteWhenInstalling, deleteWhenInstalling;        /* Delete target before copy    */            \
  168.         boolean        dontCopy, copy;                            /* Copy file or rsrc to destination */                \
  169.         fill bit[3]                                            /* Reserved */
  170.  
  171.  
  172. #define    fileAtomFlags                                                                                            \
  173.         opcodeFlags;                                                                                            \
  174.         fill bit[5];                                                                                             \
  175.         boolean        updateEvenIfNewer, leaveAloneIfNewer;     /* OK for a newer version of this file to exist */    \
  176.         boolean        updateExisting, keepExisting;            /* Keep tgt file if it already exists */            \
  177.         boolean        copyIfNewOrUpdate, copyIfUpdate;        /* Only update if target exists    */                    \
  178.         boolean        noRsrcFork, rsrcFork;                    /* Apply operation to rsrc fork */                    \
  179.         boolean        noDataFork, dataFork                    /* Apply operation to data fork    */
  180.  
  181. #define    fileAtom1Flags                                                                                            \
  182.         opcodeFlags;                                                                                            \
  183.         boolean        dontIgnoreLockedFile, ignoreLockedFile;    /* Do it even if file is locked */                    \
  184.         boolean        dontSetFileLocked, setFileLocked;         /* Set the Target file to be locked or not. */        \
  185.         boolean        useSrcCrDateToCompare, useVersProcToCompare;     /* How we determine if the target is newer. */    \
  186.         boolean        srcNeedExist, srcNeedNotExist;             /* Ignore atom if file does not exist */            \
  187.         boolean        rsrcForkInRsrcFork, rsrcForkInDataFork; /* Determines where to read the rsrc fork from */    \
  188.         boolean        updateEvenIfNewer, leaveAloneIfNewer;     /* OK for a newer version of this file to exist */    \
  189.         boolean        updateExisting, keepExisting;            /* Keep tgt file if it already exists */            \
  190.         boolean        copyIfNewOrUpdate, copyIfUpdate;        /* Only update if target exists    */                    \
  191.         boolean        noRsrcFork, rsrcFork;                    /* Apply operation to rsrc fork */                    \
  192.         boolean        noDataFork, dataFork                    /* Apply operation to data fork    */
  193.  
  194. type 'infa' {
  195.         switch {
  196.             case format0:
  197.                 key integer = 0;                            /* File Atom Format version */
  198.                 fileAtomFlags;                                /* File Atom Flags          */
  199.                 rsrcID;                                        /* tgt file spec ID */
  200.                 rsrcID;                                        /* src file spec ID */
  201.                 unsigned longInt;                            /* File Size */
  202.                 evenPaddedString;                            /* Atom Description     */
  203.                 
  204.             case format1:
  205.                 key integer = 1;                            /* File Atom version */
  206.                 fileAtom1Flags;                                /* File Atom Flags */
  207.                 unsigned longInt;                            /* File Size */
  208.                 unsigned integer;                            /* Finder Attribute Flags */
  209.                 fileSpecID;                                    /* Tgt file spec ID */
  210.                 integer = $$CountOf (Pieces);                /* Number of Source Pieces */
  211.                 wide array Pieces {
  212.                     fileSpecID;                                /* Source File Spec*/
  213.                     unsigned longInt;                        /* Target Data Fork Part Size */
  214.                     unsigned longInt;                        /* Target Rsrc Fork Part Size */
  215.                 };
  216.                 unsigned hex longint;                        /* Source Version Number in BCD format. */
  217.                 rsrcID;                                        /* Version Compare rsrc ID (zero if none) */
  218.                 rsrcID;                                        /* Atom Extender ID */
  219.                 evenPaddedString;                            /* Atom Description */
  220.         };
  221. };
  222.  
  223. /*
  224. § -------------------------------- Resource Atoms ---------------------------------*/
  225. #define    resourceAtomFlags                                                                                        \
  226.         opcodeFlags;                                                                                            \
  227.         fill bit[3];                                        /* Reserved    */                                        \
  228.         boolean        noTgtRequired, tgtRequired;                /* target req or can be created by another inra */    \
  229.         boolean        updateExisting, keepExisting;            /* Keep tgt rsrc if it already exists */            \
  230.         boolean        copyIfNewOrUpdate, copyIfUpdate;        /* Only update if target exists    */                    \
  231.         boolean        dontIgnoreProtection, ignoreProtection;    /* Do it even if rsrc protected */                    \
  232.         boolean        srcNeedExist, srcNeedNotExist;            /* Rsrc need not exist on source */                    \
  233.         boolean        byName, byID;                            /* Use name or id to find rsrc    */                    \
  234.         boolean        nameNeedNotMatch, nameMustMatch            /* name must match*/
  235.  
  236. #define    resourceAtomFlagsFormat1                                                                                        \
  237.         opcodeFlags;                                                                                            \
  238.         fill bit[2];                                        /* Reserved    */                                        \
  239.         boolean        updateEvenIfNewer, leaveAloneIfNewer;     /* OK for a newer version of this rsrsc to exist */    \
  240.         boolean        noTgtRequired, tgtRequired;                /* target req or can be created by another inra */    \
  241.         boolean        updateExisting, keepExisting;            /* Keep tgt rsrc if it already exists */            \
  242.         boolean        copyIfNewOrUpdate, copyIfUpdate;        /* Only update if target exists    */                    \
  243.         boolean        dontIgnoreProtection, ignoreProtection;    /* Do it even if rsrc protected */                    \
  244.         boolean        srcNeedExist, srcNeedNotExist;            /* Rsrc need not exist on source */                    \
  245.         boolean        byName, byID;                            /* Use name or id to find rsrc    */                    \
  246.         boolean        nameNeedNotMatch, nameMustMatch            /* name must match*/
  247.  
  248. type 'inra' {
  249.         switch {
  250.             case format0:
  251.                 key integer = 0;                            /* Resource Atom Format version */
  252.                 resourceAtomFlags;                            /* Resource Atom Flags */
  253.                 rsrcID;                                        /* tgt file spec ID */
  254.                 rsrcID;                                        /* src file spec ID */
  255.                 rsrcType;                                    /* Resource Type */
  256.                 rsrcID;                                        /* Source ID */
  257.                 rsrcID;                                        /* Target ID */
  258.                 unsigned longInt;                            /* Resource Size */
  259.                 evenPaddedString;                            /* Atom Description */
  260.                 evenPaddedString;                            /* Resource Name */
  261.  
  262.             case format1:
  263.                 key integer = 1;                /* Resource Atom Format version */
  264.                 resourceAtomFlagsFormat1;        /* Resource Atom Flags */
  265.                 unsigned longInt;                /* Total Target Size (including owned rsrcs)    */
  266.  
  267.                 fileSpecID;                        /* Target Resource File Spec */
  268.                 rsrcType;                        /* Target Resource Type */
  269.                 rsrcID;                            /* Target Resource ID */
  270.                 unsigned integer;                /* Target Resource Attributes */
  271.                 evenPaddedString;                /* Target Resource Name */
  272.  
  273.                 integer = $$CountOf (Parts);    /* Number of Parts */
  274.                 wide array Parts {
  275.                     fileSpecID;                        /* Source Part File Spec */
  276.                     rsrcType;                        /* Source Part Type    */
  277.                     rsrcID;                            /* Source Part Rsrc ID */
  278.                     unsigned longInt;                /* Target Part Size    */
  279.                     evenPaddedString;                /* Source Part Resource Name */                
  280.                 };
  281.                 unsigned hex longint;            /* Source Version Number in BCD format. */
  282.                 rsrcID;                            /* Version Compare rsrc ID (zero if none) */
  283.                 rsrcID;                            /* Atom Extender ID */
  284.                 evenPaddedString;                /* Atom Description */
  285.         };
  286. };
  287.  
  288.  
  289. type 'inr#' {
  290.         switch {
  291.             case format0:
  292.                 key integer = 0;                /* Resource Atom Format version */
  293.  
  294.                 integer = $$CountOf (inraRsrcs);    /* Number of inraRsrcs */
  295.                 wide array inraRsrcs {
  296.                     integer;                        /* resource ID ( type to be decided)    */
  297.                     resourceAtomFlagsFormat1;        /* Resource Atom Flags */
  298.                     unsigned longInt;                /* Total Target Size (including owned rsrcs)    */
  299.  
  300.                     fileSpecID;                        /* Target Resource File Spec */
  301.                     fileSpecID;                        /* Source File Spec */
  302.                     rsrcType;                        /* Source/Target Resource Type */
  303.                     rsrcID;                            /* Source/Target Resource ID */
  304.                     unsigned integer;                /* Target Resource Attributes */
  305.  
  306.                     unsigned hex longint;            /* Source Version Number in BCD format. */
  307.                     rsrcID;                            /* Version Compare rsrc ID (zero if none) */
  308.                     rsrcID;                            /* Atom Extender ID */
  309.                     unsigned longInt;                /* Target Size of Rsrc */
  310.                 };
  311.         };
  312. };
  313.  
  314.  
  315.  
  316. /*
  317. § --------------------------------- ResMerge Atoms ---------------------------------*/
  318.  
  319. #define    resMergeAtomFlags                                                                                        \
  320.         fill bit[16];
  321.  
  322. type 'inrm' {
  323.         switch {
  324.             case format0:
  325.                 key integer = 0;                            /* ResMerge Atom Format version */
  326.                 resMergeAtomFlags;                            /* ResMerge Atom Flags          */
  327.                 unsigned longInt;                            /* Size of all resources   */
  328.                 rsrcID;                                        /* tgt file spec ID */
  329.                 rsrcID;                                        /* src file spec ID */
  330.                 evenPaddedString;                            /* Atom Description     */
  331.         };
  332. };
  333.  
  334. /*
  335. § --------------------------------- Folder Atoms ---------------------------------*/
  336.  
  337. #define    folderAtomFlags                                                                                        \
  338.         fill bit[16];
  339.  
  340. type 'infm' {
  341.         switch {
  342.             case format0:
  343.                 key integer = 0;                            /* Folder Atom Format version */
  344.                 folderAtomFlags;                            /* Folder Atom Flags          */
  345.                 unsigned longInt;                            /* Size of all files in source folder */
  346.                 rsrcID;                                        /* tgt file spec ID */
  347.                 rsrcID;                                        /* src file spec ID */
  348.                 evenPaddedString;                            /* Atom Description     */
  349.         };
  350. };
  351.  
  352. /*
  353. § --------------------------------- Boot Block Atoms ---------------------------------*/
  354. #define    bootBlockAtomFlags                                                                                        \
  355.         fill bit[14];                                                                                            \
  356.         boolean        dontChangeOnInstall, changeOnInstall;    /* change parameter if we're installing */            \
  357.         boolean        dontChangeOnRemove, changeOnRemove        /* change parameter if we're removing */ 
  358.  
  359. #define    BootBlockUpdateFlags                                                                                    \
  360.         fill bit[7];                                                                                            \
  361.         boolean        replaceBBSysName,                                                                             \
  362.                     saveBBSysName;                                                                                 \
  363.         boolean        replaceBBShellName,                                                                         \
  364.                     saveBBShellName;                                                                            \
  365.         boolean        replaceBBDbg1Name,                                                                             \
  366.                     saveBBDbg1Name;                                                                             \
  367.         boolean        replaceBBDbg2Name,                                                                             \
  368.                     saveBBDbg2Name;                                                                             \
  369.         boolean        replaceBBScreenName,                                                                         \
  370.                     saveBBScreenName;                                                                             \
  371.         boolean        replaceBBHelloName,                                                                         \
  372.                     saveBBHelloName;                                                                             \
  373.         boolean        replaceBBScrapName,                                                                            \
  374.                     saveBBScrapName;                                                                             \
  375.         boolean        replaceBBCntFCBs,                                                                             \
  376.                     maxBBCntFCBs;                                                                                 \
  377.         boolean        replaceBBCntEvts,                                                                             \
  378.                     maxBBCntEvts
  379.  
  380.  
  381. type 'inbb' {
  382.         switch {
  383.             case format0:
  384.                 key integer = 0;                            /* Boot Block Format version */
  385.                 bootBlockAtomFlags;                            /* Boot Block Atom Flags      */
  386.                         
  387.                         /* now case off the type for the boot block value */
  388.                 switch {
  389.                     case bbUpdate:
  390.                         key integer = -1;
  391.                         rsrcID;                                /* The file spec ID for the source of the 'boot' resource */
  392.                         bootBlockUpdateFlags;
  393.                         
  394.                     case bbID:
  395.                         key integer = 1;
  396.                         decimal integer;
  397.                     
  398.                     case bbEntry:
  399.                         key integer = 2;
  400.                         decimal longint;
  401.                         
  402.                     case bbVersion:
  403.                         key integer = 3;
  404.                         decimal integer;
  405.                         
  406.                     case bbPageFlags:
  407.                         key integer = 4;
  408.                         decimal integer;
  409.                         
  410.                     case bbSysName:
  411.                         key integer = 5;
  412.                         evenPaddedString;
  413.                         
  414.                     case bbShellName:
  415.                         key integer = 6;
  416.                         evenPaddedString;
  417.                         
  418.                     case bbDbg1Name:
  419.                         key integer = 7;
  420.                         evenPaddedString;
  421.                         
  422.                     case bbDbg2Name:
  423.                         key integer = 8;
  424.                         evenPaddedString;
  425.                         
  426.                     case bbScreenName:
  427.                         key integer = 9;
  428.                         evenPaddedString;
  429.                         
  430.                     case bbHelloName:
  431.                         key integer = 10;
  432.                         evenPaddedString;
  433.                         
  434.                     case bbScrapName:
  435.                         key integer = 11;
  436.                         evenPaddedString;
  437.                         
  438.                     case bbCntFCBs:
  439.                         key integer = 12;
  440.                         decimal integer;
  441.                         
  442.                     case bbCntEvts:
  443.                         key integer = 13;
  444.                         decimal integer;
  445.                         
  446.                     case bb128KSHeap:
  447.                         key integer = 14;
  448.                         decimal longint;
  449.                         
  450.                     case bb256KSHeap:
  451.                         key integer = 15;
  452.                         decimal longint;
  453.                         
  454.                     case bb512KSHeap:
  455.                         key integer = 16;
  456.                         decimal longint;
  457.                         
  458.                     case bbSysHeapSize:                        /* Note - same as 512 */
  459.                         key integer = 16;
  460.                         decimal longint;
  461.                         
  462.                     case bbSysHeapExtra:
  463.                         key integer = 18;
  464.                         decimal longint;
  465.                         
  466.                     case bbSysHeapFract:
  467.                         key integer = 19;
  468.                         decimal longint;
  469.                 };
  470.                 evenPaddedString;                                /* Boot Block Atom Description */
  471.         };
  472. };
  473.  
  474.  
  475. /*
  476. § --------------------------------- Action Atoms ---------------------------------*/
  477.  
  478. #define    whenToActAAFlags                                                                                    \
  479.         boolean        actAfter,                /* Call this proc after all installations */                    \
  480.                     actBefore;                /* Call this proc before all installations */                    \
  481.         boolean        dontActOnRemove,                                                                         \
  482.                     actOnRemove;            /* Call this proc when doing a remove */                        \
  483.         boolean        dontActOnInstall,                                                                         \
  484.                     actOnInstall            /* Call this proc when doing an Install */
  485.  
  486.  
  487. #define    actionAtomFlagsFormat0                                                                                \
  488.         fill bit[13];                                                                                        \
  489.         whenToActAAFlags
  490.  
  491. #define    actionAtomFlagsFormat1                                                                                \
  492.         fill bit[12];                                                                                         \
  493.         boolean        continueBusyCursors,    /* Allow Installer busy cursor during call (3.3+ Only) */        \
  494.                     suspendBusyCursors;        /* Stop Installer busy cursor before call (3.3+ Only) */        \
  495.         whenToActAAFlags
  496.         
  497. #define    actionAtomFlagsFormat2                                                                                \
  498.         fill bit[12];                                                                                         \
  499.         boolean        continueBusyCursors,    /* Allow Installer busy cursor during call (3.3+ Only) */        \
  500.                     suspendBusyCursors;        /* Stop Installer busy cursor before call (3.3+ Only) */        \
  501.         whenToActAAFlags
  502.  
  503. type 'inaa' {
  504.         switch {
  505.             case format0:
  506.                 key integer = 0;            /* Action Atom Format version */
  507.                 actionAtomFlagsFormat0;        /* Action Atom Flags for Format 0 */
  508.                 partSpec;                    /* Resource type & id for executable resource */
  509.                 longint;                    /* RefCon that's passed to the executable resource */
  510.                 evenPaddedString;            /* Atom Description */
  511.                 
  512.             case format1:
  513.                 key integer = 1;            /* Action Atom Format version.  Use with Installer 3.3 and newer */
  514.                 actionAtomFlagsFormat1;        /* Action Atom Flags for Format 1 */
  515.                 partSpec;                    /* Resource type & id for executable resource */
  516.                 longint;                    /* RefCon that's passed to the executable resource */
  517.                 evenPaddedString;            /* Atom Description */
  518.             
  519.             case format2:
  520.                 key integer = 2;            /* Action Atom Format version.  Use with Installer 4.0 and newer.*/
  521.                 actionAtomFlagsFormat2;        /* Action Atom Flags for Format 2 */
  522.                 partSpec;                    /* Resource type & id for executable resource.  NOTE:  code rsrc has C calling interface. */
  523.                 longint;                    /* RefCon that's passed to the executable resource */
  524.                 unsigned longint;            /* Requested Memory in bytes */
  525.                 evenPaddedString;            /* Atom Description */
  526.         };
  527. };
  528.  
  529.  
  530.  
  531. /*
  532. § --------------------------------- Audit Trail Atoms ---------------------------------*/
  533. type 'inat' {
  534.         switch {
  535.             case format0:
  536.                 key integer = 0;                            /* Version */
  537.                 fileSpecID;                                    /* Target File Spec */
  538.                 OSType;                                        /* Selector */
  539.                 literal longint;                            /* Value */
  540.             };
  541. };
  542.  
  543. /*
  544. § ----------------------------------- Atom Extenders -----------------------------------*/
  545. #define    atomExtenderFlags                                        \
  546.         boolean        dontSendInitMessage, sendInitMessage;        \
  547.         boolean        dontSendBeforeMessage, sendBeforeMessage;    \
  548.         boolean        dontSendAfterMessage, sendAfterMessage;        \
  549.         boolean        dontSendSuccessMessage, sendSuccessMessage;    \
  550.         boolean        dontSendCancelMessage, sendCancelMessage;    \
  551.         boolean        continueBusyCursors, suspendBusyCursors;    \
  552.         fill bit[10];
  553.  
  554. type 'inex' {
  555.         switch {
  556.             case format0:
  557.                 key integer = 0;        /* Extender Format version */
  558.                 atomExtenderFlags;        /* Flags for Format 0 */
  559.                 partSpec;                /* Type & id of code resource */
  560.                 longint;                /* Refcon for parameter block */
  561.                 unsigned longint;        /* Requested Memory in bytes */
  562.                 evenPaddedString;        /* Status Description  */    
  563.         };
  564. };
  565.  
  566.  
  567. /*
  568. § --------------------------------- Installer Rules ---------------------------------*/
  569.  
  570. #define Version                                                                                                    \
  571.     hex byte;                                                /* System file Major revision in BCD*/                \
  572.     hex byte;                                                /* System file Minor revision in BCD*/                \
  573.     hex byte    development = 0x20,                            /* System file Release stage        */                \
  574.                 alpha = 0x40, beta = 0x60,                                                                        \
  575.                 final = 0x80, release = 0x80;                                                                    \
  576.     hex byte                                                /* Non Final */
  577.     
  578.     
  579. /* Note that if the minimal & maximal target disk sizes are both 0, any volume will match */
  580. /* If the Minimal is > 0 and the maximal = 0, then only the minimum requirement is used */
  581. #define TargetVolReqs                                        /* Required Target Volume Description */            \
  582.     decimal longint                                            /* Minimal Target Disk Size */                        \
  583.         floppy = 0,                                                                                                \
  584.         hdFloppy = 1400,                                                                                        \
  585.         hardDisk = 10000;                                                                                        \
  586.     decimal longint                                            /* Maximal Target Disk Size */                        \
  587.         floppy = 900,                                                                                            \
  588.         hdFloppy = 1500,                                                                                        \
  589.         hardDisk = 0
  590.     
  591.     
  592. #define IntegerList                                                                                                \
  593.     unsigned integer = $$CountOf(IntegerArray);                                                                    \
  594.     array IntegerArray {                                                                                        \
  595.         integer;                                                                                                \
  596.     }
  597.  
  598.  
  599. #define LongIntList                                                                                                \
  600.     unsigned integer = $$CountOf(LongIntArray);                                                                    \
  601.     array LongIntArray {                                                                                        \
  602.         longint;                                                                                                \
  603.     }
  604.  
  605.  
  606. #define packageList                                                                                                \
  607.     IntegerList
  608.  
  609.  
  610. #define assertionList                                                                                            \
  611.     IntegerList
  612.     
  613.     
  614. #define gestaltList                                                                                                \
  615.     LongIntList
  616.  
  617.  
  618. #define    alwaysFalseKey                            -2
  619. #define    alwaysTrueKey                            -1
  620. #define    checkGestaltKey                            1
  621. #define checkMinMemoryKey                        2
  622. #define    checkFileDataForkExistsKey                3
  623. #define    checkFileRsrcForkExistsKey                4
  624. #define    checkFileContainsRsrcByIDKey            5
  625. #define    checkFileContainsRsrcByNameKey            6
  626. #define    checkFileVersionKey                        7
  627. #define    checkFileCountryCodeKey                    8
  628. #define    checkTgtVolSizeKey                        9
  629. #define    checkUserFunctionKey                    10
  630. #define    checkAllAssertionsKey                    11
  631. #define    checkAnyAssertionKey                    12
  632. #define checkMoreThanOneAssertionKey            13
  633. #define    addUserDescriptionKey                    14
  634. #define    addPackagesKey                            15
  635. #define    addAssertionKey                            16
  636. #define reportVolErrorKey                        17
  637. #define reportSysErrorKey                        18
  638. #define addAuditRecKey                            19
  639. #define checkAuditRecKey                        20
  640. #define checkAnyAuditRecKey                        21
  641. #define addCustomItemsKey                         22
  642. #define checkAllNonAssertionsKey                23
  643. #define checkAnyNonAssertionKey                    24
  644. #define clearAssertionsKey                        25
  645. #define checkRuleFunctionKey                    26
  646. #define checkGestaltAttributesKey                27
  647.  
  648.  
  649.  
  650. /* The Easy Install Rules */
  651. type 'inrl' {
  652.     switch {
  653.         case format0:
  654.             key integer = 0;
  655.             hex integer = 0;                                            /* Rule Flags for future use */
  656.             unsigned integer = $$CountOf(Rules);
  657.             wide array Rules {
  658.                 switch {
  659.                     case alwaysFalse:
  660.                         key integer = alwaysFalseKey;
  661.                         
  662.                     case alwaysTrue:
  663.                         key integer = alwaysTrueKey;
  664.                         
  665.                     case checkGestalt:
  666.                         key integer = checkGestaltKey;
  667.                         OSType;                                            /* Gestalt selector */
  668.                         gestaltList;                                    /* Legal results */
  669.                     
  670.                     case checkMinMemory:
  671.                         key integer = checkMinMemoryKey;
  672.                         decimal longint;
  673.  
  674.                     case checkFileDataForkExists:
  675.                         key integer = checkFileDataForkExistsKey;
  676.                         fileSpecID;
  677.                         
  678.                     case checkFileRsrcForkExists:
  679.                         key integer = checkFileRsrcForkExistsKey;
  680.                         fileSpecID;
  681.                         
  682.                     case checkFileContainsRsrcByID:
  683.                         key integer = checkFileContainsRsrcByIDKey;
  684.                         fileSpecID;
  685.                         rsrcType;
  686.                         rsrcID;
  687.                         
  688.                     case checkFileContainsRsrcByName:
  689.                         key integer = checkFileContainsRsrcByNameKey;
  690.                         fileSpecID;
  691.                         rsrcType;
  692.                         rsrcName;
  693.                         
  694.                     case checkFileVersion:
  695.                         key integer = checkFileVersionKey;
  696.                         fileSpecID;
  697.                         version;
  698.                         
  699.                     case checkFileCountryCode:
  700.                         key integer = checkFileCountryCodeKey;
  701.                         fileSpecID;
  702.                         integer Region;
  703.                         
  704.                     case checkTgtVolSize:
  705.                         key integer = checkTgtVolSizeKey;
  706.                         targetVolReqs;
  707.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
  708.                     case checkUserFunction:
  709.                         key integer = checkUserFunctionKey;
  710.                         rsrcType;
  711.                         rsrcID;
  712.                         longint;                    /* RefCon that's passed to the executable resource */
  713.                         
  714.                     case checkAllAssertions:
  715.                         key integer = checkAllAssertionsKey;
  716.                         assertionList;
  717.                         
  718.                     case checkAnyAssertion:
  719.                         key integer = checkAnyAssertionKey;
  720.                         assertionList;
  721.                         
  722.                     case checkMoreThanOneAssertion:
  723.                         key integer = checkMoreThanOneAssertionKey;
  724.                         assertionList;
  725.                         
  726.                     case addUserDescription:
  727.                         key integer = addUserDescriptionKey;
  728.                         evenPaddedString;
  729.                         
  730.                     case addPackages:
  731.                         key integer = addPackagesKey;
  732.                         packageList;
  733.                         
  734.                     case addAssertion:
  735.                         key integer = addAssertionKey;
  736.                         assertionList;
  737.                         
  738.                     case reportVolError:
  739.                         key integer = reportVolErrorKey;
  740.                         evenPaddedString;
  741.                         
  742.                     case reportSysError:
  743.                         key integer = reportSysErrorKey;
  744.                         evenPaddedString;
  745.                         
  746.                     case addAuditRec:
  747.                         key integer = addAuditRecKey;
  748.                         fileSpecID;
  749.                         OSType;
  750.                         literal longint;
  751.                         
  752.                     case checkAuditRec:
  753.                         key integer = checkAuditRecKey;
  754.                         fileSpecID;
  755.                         OSType;
  756.                         literal longint;
  757.                         
  758.                     case checkAnyAuditRec:
  759.                         key integer = checkAnyAuditRecKey;
  760.                         fileSpecID;
  761.                         OSType;
  762.                         longIntList;
  763.                         
  764.                     case addCustomItems:
  765.                         key integer = addCustomItemsKey;
  766.                         packageList;
  767.                         
  768.                     case checkAllNonAssertions:
  769.                         key integer = checkAllNonAssertionsKey;
  770.                         assertionList;
  771.                         
  772.                     case checkAnyNonAssertion:
  773.                         key integer = checkAnyNonAssertionKey;
  774.                         assertionList;
  775.                         
  776.                     case clearAssertions:
  777.                         key integer = clearAssertionsKey;
  778.                         assertionList;
  779.                         
  780.                     case checkRuleFunction:
  781.                         key integer = checkRuleFunctionKey;
  782.                         rsrcID;
  783.                     
  784.                     case checkGestaltAttributes:
  785.                         key integer = checkGestaltAttributesKey;
  786.                         OSType;                                            /* Gestalt selector */
  787.                         literal longint;                                /* Bit Mask */
  788.                         
  789.             };
  790.         };
  791.     };
  792. };
  793.  
  794.  
  795. #define RuleList IntegerList
  796.     
  797. #define kEasyInstallFrameworkRsrcID     764
  798. #define kCustomInstallFrameworkRsrcID     766
  799. #define kGlobalFrameworkRsrcID             765
  800.     
  801. /* The rule framework */
  802. type 'infr' {
  803.     switch {
  804.         case format0:
  805.             key integer = 0;                                /* Rule framework version */
  806.             unsigned integer = $$CountOf(RuleArray);
  807.             wide array RuleArray {
  808.                 boolean pickFirst, pickAll;                    /* which packages to select? */                        
  809.                 fill bit[15];
  810.                 ruleList;                                    /* List of rules */                                    
  811.             };
  812.     };
  813. };
  814.  
  815.  
  816. /* The list of disks we may need, and the order we want them to appear in */
  817. /* This is optional. */
  818. type 'indo' {
  819.     switch {
  820.         case format0:
  821.             key integer = 0;                                /* indo version */
  822.             integer = $$Countof(StringArray);
  823.             array StringArray {
  824.                     evenPaddedString;
  825.             };
  826.             
  827.         case format1:
  828.             key integer = 1;                                /* indo version */
  829.             integer = $$Countof(SrcVolArray);
  830.             array SrcVolArray {
  831.                     SrcDiskType;
  832.                     evenPaddedString;
  833.             };
  834.     };
  835. };
  836.  
  837.  
  838. /* This script resource defines the minimum Installer version that is required */
  839. /* to run the script.  If an Installer app is launched that is older than this */
  840. /* required version, the user receives a dialog telling him/her to run a newer Installer */
  841. /* This is optional. */
  842. type 'invs' {
  843.     switch {
  844.         case format0:
  845.             key integer = 0;
  846.             hex byte;                                                /* Major revision in BCD*/
  847.             hex byte;                                                /* Minor vevision in BCD*/
  848.             hex byte    development = 0x20,                            /* Release stage        */
  849.                         alpha = 0x40,
  850.                         beta = 0x60,
  851.                         final = 0x80, /* or */ release = 0x80;
  852.             hex byte;                                                /* Non-final release #    */
  853.             pstring;                                                /* Short version number    */
  854.     };
  855. };
  856.  
  857.  
  858.  
  859. /*
  860. § -------------------------------- Font Atom & Split Atom Stuff ---------------------------------*/
  861.  
  862. #define    Style                                                                                    \
  863.     fill bit[9];                                        /* Reserved */                            \
  864.     Boolean        noExtendedStyle, extendedStyle;            /* Exteneded style */                    \
  865.     Boolean        noCondensedStyle, condensedStyle;        /* Condensed style */                    \
  866.     Boolean        noShadowStyle,     shadowStyle;            /* Shadow style */                        \
  867.     Boolean        noOutlineStyle, outlineStyle;            /* Outline style */                        \
  868.     Boolean        noUnderlineStyle, underlineStyle;        /* Underline style */                    \
  869.     Boolean        noItalicStyle, italicStyle;                /* Italic style */                        \
  870.     Boolean        noBoldStyle, boldStyle;                    /* Bold style */
  871.  
  872. #define    RsrcSpec                                                                                \
  873.         fileSpecID;                                        /* File spec for this resource */        \
  874.         rsrcType;                                        /* Type of the resource    */                \
  875.         rsrcID;                                            /* ID of the resource */                \
  876.         unsigned longInt;                                /* Size in bytes of this resource    */    \
  877.         evenPaddedString                                /* Name of the resource */                
  878.  
  879. #define    SrcPartsList                                    /* The list of pieces */                \
  880.         integer = $$CountOf (Parts);                    /* How many of them? */                    \
  881.         wide array Parts {                                                                        \
  882.             RsrcSpec;                                    /* Description of this piece */            \
  883.         }
  884.  
  885. #define resSysHeap        64                                /* Defines for resource attributes */
  886. #define resPurgeable    32
  887. #define resLocked        16
  888. #define resProtected    8
  889. #define resPreload        4
  890. #define resChanged        2
  891.  
  892. #define Strike                                                                                    \
  893.     integer;                                            /* Font size */                            \
  894.     Style;                                                /* Which styles? */                        \
  895.     RsrcType;                                            /* Target Font Resource Type */            \
  896.     integer;                                            /* Target Attributes */                    \
  897.     SrcPartsList;                                        /* All of the pieces */
  898.  
  899. #define fontFamilyAtomFlags                                                                                        \
  900.         opcodeFlags;                                                                                            \
  901.         fill bit[2];                                        /* Reserved    */                                        \
  902.         boolean        noEncodedFONDRsrc, encodedFONDRsrc;        /* source 'FOND' data is stored as 'iFND' rsrc */    \
  903.         boolean        noTgtRequired, tgtRequired;                /* target req or can be created by another inff */    \
  904.         boolean        updateExisting, keepExisting;            /* Keep tgt rsrc if it already exists */            \
  905.         boolean        copyIfNewOrUpdate, copyIfUpdate;        /* Only update if target exists    */                    \
  906.         boolean        dontIgnoreProtection, ignoreProtection;    /* Do it even if rsrc protected */                    \
  907.         boolean        srcNeedExist, srcNeedNotExist;            /* Rsrc need not exist on source */                    \
  908.         boolean        byName, byID;                            /* Use name or id to find strike rsrc    */            \
  909.         boolean        nameNeedNotMatch, nameMustMatch            /* name must match if finding strike by ID */
  910.     
  911. type 'inff' {
  912.     switch {
  913.         case format0:
  914.             key integer = 0;                            /*format version 0 */
  915.             resourceAtomFlags;                            /* flags */
  916.             fileSpecID;                                    /* Target File Spec */
  917.             fileSpecID;                                    /* Source File Spec of the FOND and all pieces, unless overriden by a split definition */
  918.             unsigned integer;                            /* Target FOND Attributes */
  919.             unsigned longInt;                            /* size in bytes of the complete family set */
  920.             rsrcID;                                        /* source FOND's resource ID */
  921.             switch {
  922.             case entireFamily:
  923.                  key integer = 1;
  924.             case explicitFamilyMembers:
  925.                 key integer = 2;
  926.                 unsigned integer = $$CountOf(StrikeEntries);
  927.                 wide array StrikeEntries {
  928.                     Strike;                                /* Source for each of the points */
  929.                 };
  930.             };
  931.             evenPaddedString;                            /* Atom Description */
  932.             evenPaddedString;                            /* the exact family name */
  933.             
  934.         case format1:
  935.             key integer = 1;                            /*format version 1 */
  936.             resourceAtomFlags;                            /* flags */
  937.             fileSpecID;                                    /* Target File Spec */
  938.             fileSpecID;                                    /* Source File Spec of the FOND and all pieces, unless overriden by a split definition */
  939.             unsigned integer;                            /* Target FOND Attributes */
  940.             unsigned longInt;                            /* size in bytes of the complete family set */
  941.             rsrcID;                                        /* source FOND's resource ID */
  942.             switch {
  943.             case entireFamily:
  944.                  key integer = 1;
  945.             case explicitFamilyMembers:
  946.                 key integer = 2;
  947.                 unsigned integer = $$CountOf(StrikeEntries);
  948.                 wide array StrikeEntries {
  949.                     Strike;                                /* Source for each of the points */
  950.                 };
  951.             };
  952.             rsrcID;                                        /* Atom Extender ID */
  953.             evenPaddedString;                            /* Atom Description */
  954.             evenPaddedString;                            /* the exact family name */
  955.  
  956.         case format2:
  957.             key integer = 2;                            /*format version 2 */
  958.             fontFamilyAtomFlags;                        /* flags, only difference between format1 and format2*/
  959.             fileSpecID;                                    /* Target File Spec */
  960.             fileSpecID;                                    /* Source File Spec of the FOND and all pieces, unless overriden by a split definition */
  961.             unsigned integer;                            /* Target FOND Attributes */
  962.             unsigned longInt;                            /* size in bytes of the complete family set */
  963.             rsrcID;                                        /* source FOND's resource ID */
  964.             switch {
  965.             case entireFamily:
  966.                  key integer = 1;
  967.             case explicitFamilyMembers:
  968.                 key integer = 2;
  969.                 unsigned integer = $$CountOf(StrikeEntries);
  970.                 wide array StrikeEntries {
  971.                     Strike;                                /* Source for each of the points */
  972.                 };
  973.             };
  974.             rsrcID;                                        /* Atom Extender ID */
  975.             evenPaddedString;                            /* Atom Description */
  976.             evenPaddedString;                            /* the exact family name */
  977.     };
  978. };
  979.  
  980.  
  981. /*
  982. § ----------------------------------- Preference Resource -----------------------------------*/
  983. #define    preferenceFlags                                                        \
  984.         boolean        useDiskTargetMode, useFolderTargetMode;                    \
  985.         boolean        dontAllowUserToSetSystemDisk, allowUserToSetSystemDisk;    \
  986.         boolean        dontShowSelectedSizeInCustom, showSelectedSizeInCustom;    \
  987.         boolean        noSetupFunctionSupplied, setupFunctionSupplied;            \
  988.         boolean        dontAllowCleanInstall, allowCleanInstall;                \
  989.         boolean        dontAllowServerAsTarget, allowServerAsTarget;            \
  990.         fill bit[10];
  991.  
  992. /*  NOTE:  The 'allowServerAsTarget' flag is an unsupported and untested feature.  Only
  993. those scriptwriters that absolutley, positively, must allow their users to
  994. install onto AppleShare server volumes should use the 'allowServerAsTarget' flag!  And if
  995. you install on an AppleShare volume, never, ever install anything into its System Folder!!
  996. */
  997.  
  998. type 'inpr' {
  999.         switch {
  1000.             case format0:
  1001.                 key integer = 0;        /* Preference version */
  1002.                 preferenceFlags;        /* Preference Flags */
  1003.                 rsrcType;                /* Type of code resource for Setup Function */
  1004.                 rsrcID;                    /* Id of code resource for Setup Function */
  1005.                 unsigned integer = $$CountOf(helpPagelist);    /* Help page List */
  1006.                 wide array helpPagelist {
  1007.                     rsrcID;                                /* B&W left edge picture */
  1008.                     rsrcID;                                /* B&W main text */
  1009.                     rsrcID;                                /* 8-Bit left edge picture */
  1010.                     rsrcID;                                /* 8-Bit main text */
  1011.                 };
  1012.                 evenPaddedString;        /* Default Folder name, if no Setup Function supplied */    
  1013.         };
  1014. };
  1015.  
  1016.  
  1017.  
  1018.  
  1019. /*
  1020. § ----------------------------------- Search Procedure -----------------------------------*/
  1021. #define    searchProcedureFlags        \
  1022.         fill bit[16];
  1023.  
  1024. type 'insp' {    
  1025.     switch {
  1026.         case format0:
  1027.             key integer = 0;        /* Search Procedure Format version */
  1028.             searchProcedureFlags;    /* Search Procedure Flags */
  1029.             rsrcType;                /* Search Procedure Code Rsrc Type   NOTE:  code rsrc has C calling interface.*/
  1030.             rsrcID;                    /* Search Procedure Code Rsrc ID */
  1031.             longint;                /* RefCon Value */
  1032.             unsigned longint;        /* Requested Memory in bytes */
  1033.             evenPaddedString;        /* Optional Summary String, not shown to user */    
  1034.     };
  1035. };
  1036.  
  1037.  
  1038. /*
  1039. § ----------------------------------- Action Handlers -----------------------------------*/
  1040. #define    actionHandlerFlags        \
  1041.         fill bit[16];
  1042.  
  1043. type 'inah' {
  1044.         switch {
  1045.             case format0:
  1046.                 key integer = 0;        /* Format version */
  1047.                 actionHandlerFlags;        /* Action Handler Flags */
  1048.                 rsrcType;                /* Action Handler Code Rsrc Type   NOTE:  code rsrc has C calling interface.*/
  1049.                 rsrcID;                    /* Action Handler Code Rsrc ID */
  1050.                 unsigned longint;        /* Requested Memory in bytes */
  1051.                 evenPaddedString;        /* Optional Summary String, not shown to user */    
  1052.         };
  1053. };
  1054.  
  1055.  
  1056. /*
  1057. § ----------------------------------- Version Compare -----------------------------------*/
  1058. #define    versionCompareFlags        \
  1059.         fill bit[16];
  1060.  
  1061. type 'invc' {
  1062.         switch {
  1063.             case format0:
  1064.                 key integer = 0;        /* Format version */
  1065.                 versionCompareFlags;    /* Flags for Format 0 */
  1066.                 rsrcType;                /* Version Proc. Code Rsrc Type   NOTE:  code rsrc has C calling interface.*/
  1067.                 rsrcID;                    /* Version Proc. Code Rsrc ID */
  1068.                 unsigned longint;        /* Requested Memory in bytes */
  1069.                 evenPaddedString;        /* Optional Summary String, not shown to user */    
  1070.         };
  1071. };
  1072.  
  1073.  
  1074. /*
  1075. § ----------------------------------- Rule Function -----------------------------------*/
  1076. #define    ruleFunctionFlags        \
  1077.         fill bit[16];
  1078.  
  1079. type 'inrf' {
  1080.         switch {
  1081.             case format0:
  1082.                 key integer = 0;        /* Format version */
  1083.                 ruleFunctionFlags;        /* Flags for Format 0 */
  1084.                 rsrcType;                /* Rule Function Code Rsrc Type   NOTE:  code rsrc has C calling interface.*/
  1085.                 rsrcID;                    /* Rule Function Code Rsrc ID */
  1086.                 longint;                /* RefCon Value */
  1087.                 unsigned longint;        /* Requested Memory in bytes */
  1088.                 evenPaddedString;        /* Optional Summary String, not shown to user */    
  1089.         };
  1090. };
  1091.  
  1092.  
  1093. /*
  1094. § ------------------------------ Script Sub-Heap Size Resource -------------------------------*/
  1095. type 'insz' {
  1096.         switch {
  1097.             case format0:
  1098.                 key integer = 0;        /* Format version */
  1099.                 unsigned longint;        /* Script Sub-Heap Size in bytes */
  1100.         };
  1101. };
  1102.  
  1103.  
  1104.